//
//  MyAccountCell.m
//  FactorySale
//
//  Created by 主事丫环HU on 2020/8/7.
//  Copyright © 2020 主事丫环. All rights reserved.
//

#import "MyAccountCell.h"
@interface MyAccountCell()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;
@end
@implementation MyAccountCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
+ (instancetype)cellWithTableView:(UITableView *)tableView {
    
    static NSString *ID = @"MyAccountCell";
    
    MyAccountCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        
        cell = [NSBundle.mainBundle loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}
- (void)setModel:(MyAccountListModel *)model{
    if ([model.type isEqualToString:@"1"]) {//1充值 2补助金扣除
        self.titleLabel.text = @"充值";
        self.moneyLabel.text = [NSString stringWithFormat:@"+%@",model.money];
        self.moneyLabel.textColor = [UIColor colorWithHexString:@"#F99148"];
    } else {
        self.titleLabel.text = @"补助金扣除";
        self.moneyLabel.text = [NSString stringWithFormat:@"%@",model.money];
        self.moneyLabel.textColor = [UIColor colorWithHexString:@"#333333"];
    }
    self.timeLabel.text = model.createDate;
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
